<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>民生银行银企直连</title>
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="小镖人、平台银行、银企直连">
    <meta name="description" content="小镖人、平台银行、银企直连">
    <link rel="stylesheet" href="../../xbr_layui_extend/layui-v2.6.8/css/layui.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
<div class="layui-row page-title ">
    <div class="heading-page">
        <img class="heading-logo" src="../../static/img/民生银行.png" height="60px" alt=""/>
        <span class="heading-title">
            <div>民生银行银企直连</div>
            <div style="font-size: 12px;margin-top: 8px" id="currentAddress"></div>
        </span>
    </div>
    <div class="heading-right">
        <button class="layui-btn layui-btn-primary layui-border-blue" id="currentPlat">当前平台：正在获取...</button>
    </div>
</div>
<hr>
<div class="layui-row">
    <div class="layui-col-sm3 box-left">
        <fieldset class="layui-elem-field ">
            <legend>连接状态</legend>
            <img src="../../static/img/bank-status/状态机-前置故障.svg" id="bankStatus" width="100%" alt=""/>
            <p style="text-align: right;padding: 0 24px" id="updateTime">无数据</p>
            <div class="pc-param">
                <h3>配置参数</h3>
                <p>协议：<span style="float: right" id="agreement">无数据</span></p>
                <p>前置机端口：<span style="float: right" id="port">无数据</span></p>
                <p>前置机IP：<span style="float: right" id="host">无数据</span></p>
                <p>路径：<span style="float: right" id="url">无数据</span></p>
                <p>说明：<span style="float: right">如果出现地址，端口不正确，请联系相关运维人员进行处理。</span></p>
            </div>
        </fieldset>
    </div>
    <div class="layui-col-sm9 box-right">
        <fieldset class="layui-elem-field ">
            <legend>常用业务</legend>
            <div class="pc-menu-item" title="单笔转账查询" urlHtml="./open/transfer/qryXfer.html">
                <img class="heading-logo" src="../../static/img/bank-item/单笔转账.svg" alt=""/>
                <h3>单笔转账查询</h3>
            </div>
            <div class="pc-menu-item" title="批量转账查询" urlHtml="./open/transfer/qryBatchXfer.html">
                <img class="heading-logo" src="../../static/img/bank-item/批量转账查询.svg" alt=""/>
                <h3>批量转账查询</h3>
            </div>
            <div class="pc-menu-item" title="费用报销，代发工资查询" urlHtml="./open/transfer/qryBatchCostRimbNew.html">
                <img class="heading-logo" src="../../static/img/bank-item/批量转账查询.svg" alt=""/>
                <h3>费用报销，代发工资查询</h3>
            </div>
        </fieldset>
        <fieldset class="layui-elem-field ">
            <legend>交易查询</legend>
            <div class="pc-menu-item" title="定期账户明细查询" urlHtml="./open/balanceDetails/depositAccountDetail.html">
                <img class="heading-logo" src="../../static/img/bank-item/流水查询.svg" alt=""/>
                <h3>定期账户明细</h3>
            </div>
            <div class="pc-menu-item" title="银企直联明细下载" urlHtml="./open/balanceDetails/trsDtlDownLoad.html">
                <img class="heading-logo" src="../../static/img/bank-item/下载任务.svg" alt=""/>
                <h3>银企直联明细下载</h3>
            </div>
            <div class="pc-menu-item" title="余额交易查询(新)" urlHtml="./open/balanceDetails/qryBalNew.html">
                <img class="heading-logo" src="../../static/img/bank-item/余额.svg" alt=""/>
                <h3>余额查询交易</h3>
            </div>
            <div class="pc-menu-item" title="历史余额查询" urlHtml="./open/balanceDetails/qryHistoryBal.html">
                <img class="heading-logo" src="../../static/img/bank-item/余额.svg" alt=""/>
                <h3>历史余额查询</h3>
            </div>
            <div class="pc-menu-item" title="交易明细查询" urlHtml="./open/balanceDetails/qryTrsDtl.html">
                <img class="heading-logo" src="../../static/img/bank-item/余额.svg" alt=""/>
                <h3>交易明细查询</h3>
            </div>
            <div class="pc-menu-item" title="交易对账单下载(PDF)" urlHtml="./open/balanceDetails/electNotePrint.html">
                <img class="heading-logo" src="../../static/img/bank-item/下载任务.svg" alt=""/>
                <h3>交易明细PDF下载</h3>
            </div>

        </fieldset>
        <fieldset class="layui-elem-field ">
            <legend>其他</legend>
            <div class="pc-menu-item" title="活期存款列表查询交易" urlHtml="./open/otherOperations/qryAcctList.html">
                <img class="heading-logo" src="../../static/img/bank-item/存款.svg" alt=""/>
                <h3>活期存款列表</h3>
            </div>
            <div class="pc-menu-item" title="客户回单查询" urlHtml="./open/otherOperations/electnoteListQry.html">
                <img class="heading-logo" src="../../static/img/bank-item/回单.svg" alt=""/>
                <h3>账单回单下载</h3>
            </div>
            <div class="pc-menu-item" title="利率查询" urlHtml="./open/otherOperations/interestSettlementQry.html">
                <img class="heading-logo" src="../../static/img/bank-item/利率.svg" alt=""/>
                <h3>利率查询</h3>
            </div>
        </fieldset>
    </div>
</div>

<script src="../../xbr_layui_extend/layui-v2.6.8/layui.js"></script>
<script>
    layui.extend({
        admin: '/platform/xbr_layui_extend/admin' //集成路径
    }).use(["admin", 'carousel', "layer", 'jquery', "echarts"], function () {
        //##########################################头部##################################################

        const $ = layui.$,  admin = layui.admin, layer = layui.layer, carousel = layui.carousel;
        ///检查初始化
        carousel.render({
            elem: '#test1'
            , width: '100%' //设置容器宽度
            , arrow: 'always' //始终显示箭头
            //,anim: 'updown' //切换动画方式
        });

        initPlat();
        //##########################################头部##################################################
        function initPlat() {
            $("#currentAddress").html(window.location.href.split("?")[0]);
            const token = admin.getParam("token");
            if (token!=null) admin.saveToken(token);
            admin.req({
                url: "/platform/user/getLoginUserInfo",
                data: {token: admin.getParam("token")},
                done: function (res) {
                    if (res.data == null) {
                        document.getElementById("currentPlat").innerHTML="未初始化";
                        return;
                    }
                    document.getElementById("currentPlat").innerHTML=res.data['organizeName'];
                    //---------------------------
                    getEntNoticeQryB2e();
                    getCmbcInfoLoade();
                }
            });
        }

        function getCmbcInfoLoade() {
            admin.req({
                url: "/platform/cmbc/getCmbcInfo",
                data: {},
                done: function (res) {
                    const data = res.data['reqUrl'];
                    const parsedUrl = new URL(data);
                    if (parsedUrl) {
                        document.getElementById("agreement").innerHTML = parsedUrl.protocol;
                        document.getElementById("host").innerHTML = parsedUrl.hostname;
                        document.getElementById("url").innerHTML = parsedUrl.pathname;
                        document.getElementById("port").innerHTML = parsedUrl.port;
                    }
                }
            });
        }

        $("#currentPlat").click(function () {  // 登录按钮
            //弹出页面
            layer.open({
                type: 2,
                title: '登录',
                content: '../user/lverifyCode.html', // 替换为实际页面的 URL
                area: ['600px', '300px'],
                maxmin: true,
                end: function () {   // 弹层关闭后执行回调事件
                    location.reload(); // 刷新当前页面
                }
            });
        });

        //#########################################图表#################################################

        //公告
        function getEntNoticeQryB2e() {
            admin.req({
                url: "/platform/cmbc/getEntNoticeQryB2e",
                data: {},
                done: function () {
                    document.getElementById("bankStatus").src = "../../static/img/bank-status/状态机-正常.svg";
                    const now = new Date();
                    const year = now.getFullYear();
                    const month = String(now.getMonth() + 1).padStart(2, '0');
                    const day = String(now.getDate()).padStart(2, '0');
                    const hours = String(now.getHours()).padStart(2, '0');
                    const minutes = String(now.getMinutes()).padStart(2, '0');
                    const seconds = String(now.getSeconds()).padStart(2, '0');
                    const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
                    document.getElementById("updateTime").innerHTML = "最后更新时间：" + formattedDate;
                }
            });
        }
        //#########################################操作按钮#################################################

        $(document).on('click', ".pc-menu-item", function () {
            const urlHtmlValue = $(this).attr('urlHtml');
            const titleValue = $(this).attr('title');
            let widthValue = $(this).attr('sizeWidth');
            let heigthValue = $(this).attr('sizeHeight');
            if (!widthValue || widthValue === "null") widthValue = "800px";
            if (!heigthValue || heigthValue === "null") heigthValue = "600px";
            layer.open({
                type: 2,
                title: titleValue,
                content: urlHtmlValue, // 替换为实际页面的 URL
                area: [widthValue, heigthValue],
                maxmin: true,
            });
        });
    });
</script>
</body>
